from unstructured.partition.docx import partition_docx
import os

# 使用示例
file_path = 'D:\\VS-workspace\\A002_AIPython学习\\示例资料及练习\\01-人机结对编程的十二条原则.docx'
if os.path.exists(file_path):
    elements  = partition_docx(filename=file_path)
    for element in elements:
        print(element.text)

"""
需要python-docx库支持，pip install python-docx
运行结果：成功
2025-05-01 

"""    